#ifndef G_PRIM_GUARD
#define G_PRIM_GUARD

#include <iostream>

struct point
{
   double x, y;
   point(double x, double y);
   point();

   bool operator ==(const point&) const;
   bool operator !=(const point&) const;
   bool operator >=(const point&) const;
   bool operator >(const point&) const;
   bool operator <=(const point&) const;
   bool operator <(const point&) const;

private:
   int compare_to(const point&) const;

   friend std::istream& operator >>(std::istream&, point&);
   friend std::ostream& operator <<(std::ostream&, const point&);
};



struct segment
{
   point a, b;
   segment(point, point);

private:
   friend std::istream& operator >>(std::istream&, segment&);
   friend std::ostream& operator <<(std::ostream&, const segment&);
};

std::istream& operator >>(std::istream&, point&);
std::ostream& operator <<(std::ostream&, const point&);

std::istream& operator >>(std::istream&, segment&);
std::ostream& operator <<(std::ostream&, const segment&);

#endif